package edu.sctu.zhengsenwen.month201506.day20150628;

import java.io.IOException;

/**
 * Created by user15 on 2015/6/28.
 */
public class Goods {

    public void goodsNumber() throws IOException, ClassNotFoundException {

        JsonAppbean jsonAppbean = new DirectoryAndTxt().writeInAppbeantxt();

        int size = jsonAppbean.list.size();

        int count = 0;
        int number = 0;

        for (int i = 0; i < size; i++) {
            try {
                float price = Float.parseFloat(jsonAppbean.list.get(i).goods_price);

                if (price > 100) {
                    count++;


                } else if (price < 100) {
                    number++;

                }
            } catch (Exception e) {
            }
        }
        System.out.println("小于100元的商品数量" + number);
        System.out.println("大于100元的商品数量" + count);

    }
}
